﻿<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-access="property" default-lazy="true" namespace="Cms.Domain" assembly="Cms.Domain">
  <class name="Administrator" table="cmsAdministrator">
    <cache usage="read-write" />
    <id name="ID" type="System.Int32" unsaved-value="0">
      <column name="ID" />
      <generator class="identity" />
    </id>
    <property name="Username" type="System.String">
      <column name="Username" not-null="true" />
    </property>
    <property name="Password" type="System.String">
      <column name="Password" not-null="true" />
    </property>
    <property name="Email" type="System.String">
      <column name="Email" />
    </property>
    <property name="Firstname" type="System.String">
      <column name="Firstname" />
    </property>
    <property name="Lastname" type="System.String">
      <column name="Lastname" />
    </property>
    <property name="Deleted" type="System.Boolean">
      <column name="Deleted" not-null="true" />
    </property>
    <property name="DefaultSystemLocale" type="System.String">
      <column name="DefaultSystemLocale" not-null="true" />
    </property>
    <property name="Created" type="System.DateTime">
      <column name="Created" not-null="true" />
    </property>
    <property name="FirstLogin" type="System.Nullable`1[[System.DateTime, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
      <column name="FirstLogin" />
    </property>
    <property name="LatestLogin" type="System.Nullable`1[[System.DateTime, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
      <column name="LatestLogin" />
    </property>
    <property name="DateFormat" type="System.String">
      <column name="DateFormat" length="20" not-null="false" />
    </property>
    <property name="TimeFormat" type="System.String">
      <column name="TimeFormat" length="20" not-null="false" />
    </property>
    <property name="FirstDayOfWeek" type="System.Nullable`1[[System.DayOfWeek, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
      <column name="FirstDayOfWeek" not-null="false" />
    </property>
    <property name="SelectedFolderID" type="System.Int32">
      <column name="SelectedFolderID" not-null="true" />
    </property>
    <property name="SelectedMediaFolderID" type="System.Int32">
      <column name="SelectedMediaFolderID" not-null="true" />
    </property>
    <property name="SerializedSearchContentSettings" type="System.String">
      <column name="SerializedSearchContentSettings" length="1000000" not-null="false" />
    </property>
    <property name="ShowIntroHelp" type="System.Boolean">
      <column name="ShowIntroHelp" not-null="true" />
    </property>
    <property name="ForceLogout" type="System.Boolean">
      <column name="ForceLogout" not-null="true" />
    </property>
    <bag cascade="all-delete-orphan" inverse="true" name="VisitedAdminUrls" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="AdministratorID" />
      </key>
      <one-to-many class="VisitedAdminUrl" />
    </bag>
    <bag cascade="all-delete-orphan" inverse="true" name="VisitedPublicUrls" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="AdministratorID" />
      </key>
      <one-to-many class="VisitedPublicUrl" />
    </bag>
    <many-to-one class="AdministratorGroup" name="Group">
      <column name="GroupID" not-null="true" />
    </many-to-one>
    <many-to-one class="Site" name="DefaultSite">
      <column name="DefaultSiteID" />
    </many-to-one>
    <many-to-one class="Site" name="CurrentSite">
      <column name="CurrentSiteID" />
    </many-to-one>
    <many-to-one class="Locale" name="CurrentSiteLocale">
      <column name="CurrentSiteLocaleID" />
    </many-to-one>
    <bag name="AvailableSites" table="cmsAdministratorAvailableSite" mutable="true">
      <cache usage="read-write" />
      <key column="AdministratorID" />
      <many-to-many class="Site" column="SiteID" />
    </bag>
    <bag cascade="all-delete-orphan" name="ClosedFolders" table="cmsAdministratorClosedFolder">
      <cache usage="read-write" />
      <key>
        <column name="AdministratorId" />
      </key>
      <element type="System.Int32">
        <column name="FolderId" />
      </element>
    </bag>
    <bag cascade="all-delete-orphan" name="ClosedMediaFolders" table="cmsAdministratorClosedMediaFolder">
      <cache usage="read-write" />
      <key>
        <column name="AdministratorId" />
      </key>
      <element type="System.Int32">
        <column name="MediaFolderId" />
      </element>
    </bag>
  </class>
</hibernate-mapping>